home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / gcctest / tests05.zoo / strerror.c < prev    next >
C/C++ Source or Header  |  1992-03-28  |  317b  |  21 lines

  1. /* from Henry Spencer's stringlib */
  2. #include <string.h>
  3.  
  4. /*
  5.  * strerror - map error number to descriptive string
  6.  *
  7.  */
  8.  
  9. char *
  10. strerror(errnum)
  11. int errnum;
  12. {
  13.     extern int sys_nerr;
  14.     extern char *sys_errlist[];
  15.  
  16.     if (errnum >= 0 && errnum < sys_nerr)
  17.         return(sys_errlist[errnum]);
  18.     else
  19.         return("unknown error");
  20. }
  21.